<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>pkp</title>
    <script>
        function display() {
           var a = ["img/1.jpg","img/2.jpg","img/3.jpg","img/4.jpg",
                "img/5.jpg","img/6.jpg","img/7.jpg","img/8.jpg"];
            var cloned=[];
            var count=3;
            for (var i = 0; i < count; i++) {
                var rand = Math.floor(Math.random() * a.length);
                cloned.push(a[rand]);
                a.splice(rand,1);
            }
            pkp.innerHTML="您的扑克牌："+cloned.join(" ");
        };
        onload=function(){
            display();
        };
    </script>
</head>
<body>


</body>
<div id="pkp">pkp</div>
</html>